package com.sgai.zero_robot.ui.history;


import com.sgai.zero_robot.database.ZeroDetectionRepository;

public class DeleteRunnable implements Runnable {
    private final RunnableCallBack<Boolean> callBack;
    private final ZeroDetectionRepository repository;
    private final String lineName;
    private final String towerNum;
    private final int install;

    public DeleteRunnable(ZeroDetectionRepository repository,String lineName,String towerNum,int install, RunnableCallBack<Boolean> callBack){
        this.callBack=callBack;
        this.repository=repository;
        this.lineName=lineName;
        this.towerNum=towerNum;
        this.install=install;
    }
    @Override
    public void run() {
        repository.deleteByParams(lineName,towerNum,install);
        if (callBack!=null){
            callBack.onResult(true);
        }
    }
}